﻿<!-- #include file="ding.asp" -->
<!-- #include file="mymin.asp" -->
<%Call Head()%>
<card title="添加栏目类别">
<p>
<%
Dim id,lxl,class1,relid,num,hide,parent,lx,br,pid,wmltxt,rs
IF KEY<>0 then
	Call Error("你的权限不足！")
end if
id= cint(request("id"))
lxl= cint(request("lxl"))
class1=request("class1")
relid=request("relid")
num=request("num")
pid=getN("pid",0)
br=getN("br",1)
parent=request.form("parent")
hide=getN("hide",0)'默认显示
lx=request.form("lx")
lid=request.form("lid")
wmltxt=Trim(request.form("wmltxt"))

if class1="" then
	Call Error("栏目名称不能为空！")
end if

if relid="" or IsNumeric(relid)=False then
	relid=0
end if

if num="" or IsNumeric(num)=False then
	num=0
end if

if lx="" or IsNumeric(lx)=False then
	Call Error("类型无效！")
end if

if parent="" or IsNumeric(parent)=False then parent=0

if lid <>"" then
	if IsNumeric(lid)=False then
		Call Error("ID无效！")
	end if
	relid=lid
end if

'lx为10~17时 wmltxt 表示多个文章，帖子ID
If lx>9 And lx<18 Then
	wmltxt=forComma(wmltxt)
	If wmltxt<>"" And checkStringForSqlInNum(wmltxt)=False Then Call Error("栏目ID无效！")
	num=int(num)
	If num<1 Then num=1
End If

set rs=server.createobject("adodb.recordset")
rs.open "select * from 74hu_class",myconn,2,3
rs.addnew
rs("class")=class1
rs("pid")=pid
rs("br")=br
rs("lx")=lx
rs("parent")=parent
rs("relid")=relid
rs("wmltxt")=wmltxt
rs("num")=num
rs("hide")=hide
rs.update
rs.close
set rs=nothing

%>
栏目添加成功!
<br/>----------<br/>
<%if id<>0 then %>
<a href="Clist.asp?sid=<%=sid%>&amp;id=<%=id%>&amp;lx=<%=lxl%>">[栏目分类]</a><br/>
<%end if%>
<a href='class.asp?sid=<%=sid%>'>[栏目分类]</a><%Call rootLast%>